var page=(function(ns){
    
    //页面初始化
    ns.init=function(){
    	var filter = searchs.getData();
    	grid.load( filter );
    }
    
    //自定义单元格
    ns.tdtpl=function(e){
    	return e.value;
    }
    
    //跳转链接
    ns.link=function(e){
    	console.log( grid.getSelectedRows() )
    }
    
    //查询
    ns.query=function(filter){
        grid.load(filter)
    }
    
    //删除
    ns.del=function(){
        grid.deleteSelectRow(); 
    }
    
    //新增
    ns.add=function(){
        $.openWin("system/testMng/edit?oid=&mode=1", "新增",['900px', '550px']);
    }
    
    //编辑
    ns.edit=function(){
    	var selectedRow=grid.getSelectedRows()[0];
        var filter={
            url:"system/testMng/edit",
            oid:selectedRow.id,
            mode:2
        }
        $.openWin(filter, "编辑",['900px', '550px']); 
    }
    
    //获取选中行
    ns.getSelectedRows=function(){
        console.log(grid.getSelectedRows())
    }
    
    //获取所有行数据
    ns.rows=function(){
        console.log(grid.getRows())
    }
    
    //导出
    ns.export=function(){
        grid.exportXls()
    }
    
    return ns;
}({}));

$(function(){  page.init() });



